<!DOCTYPE html>
<html lang="zh" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>MongoDB数据库详情</title>
    <meta content="webkit" name="renderer">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"
          name="viewport">
    <link href="./layui/css/layui.css" media="all" rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link href="./style/admin.css" media="all" rel="stylesheet" th:href="@{/style/admin.css}">
    <link href="./style/myself.css" media="all" rel="stylesheet" th:href="@{/style/myself.css}">
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="./js/html5.min.js" th:src="@{/js/html5.min.js}"></script>
    <script src="./js/respond.min.js" th:src="@{/js/respond.min.js}"></script>
    <![endif]-->
    <script charset="utf-8" th:inline="javascript" type="text/javascript">
        var ctxPath = /*[[@{/}]]*/'';
        var tokenValue = /*[[${_csrf.token}]]*/'';
        // 数据库详情的主键ID
        var id = [[${monitorDbVo.id}]];
        var authority = [[${#authorization.expression('hasAuthority("超级管理员")')}]];
    </script>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li class="layui-this">信息</li>
                <li>概要</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <table id="list-table-mongo-info" lay-filter="list-table-mongo-info"></table>
                            <script id="imgTpl-mongo-info" type="text/html">
                                <img style="display: inline-block; width: 50%; height: 100%;" src={{ d.avatar }}>
                            </script>
                            <script id="list-table-mongo-info-toolbar" type="text/html">
                                <div class="layui-btn-container">
                                    <button class="layui-btn layui-btn-sm layuiadmin-btn-useradmin"
                                            lay-event="batchRefresh">
                                        <i class="layui-icon layui-icon-refresh"></i>刷新
                                    </button>
                                </div>
                            </script>
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">
                    <form action="javascript:;" class="layui-form layui-form-pane" id="layuiadmin-form-useradmin">
                        <div class="layui-form-item">
                            <label class="layui-form-label">数据库ID</label>
                            <div class="layui-input-block">
                                <input class="layui-input" disabled name="id" th:value="${monitorDbVo.id}" type="text">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">连接名</label>
                            <div class="layui-input-block">
                                <input class="layui-input" disabled name="connName" th:value="${monitorDbVo.connName}"
                                       type="text">
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">URL</label>
                            <div class="layui-input-block">
                                <textarea class="layui-textarea" disabled name="url" th:text="${monitorDbVo.url}">
                                </textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">类型</label>
                            <div class="layui-input-block">
                                <input class="layui-input" disabled name="dbType" th:value="${monitorDbVo.dbType}"
                                       type="text">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">驱动类</label>
                            <div class="layui-input-block">
                                <input class="layui-input" disabled name="driverClass" th:value="${monitorDbVo.driverClass}"
                                       type="text">
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">描述</label>
                            <div class="layui-input-block">
                                <textarea class="layui-textarea" disabled name="dbDesc"
                                          th:text="${monitorDbVo.dbDesc}"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">状态</label>
                            <div class="layui-input-block">
                                <input class="layui-input" disabled name="isOnline" th:if="${monitorDbVo.isOnline=='0'}"
                                       type="text" value="异常">
                                <input class="layui-input" disabled name="isOnline" th:if="${monitorDbVo.isOnline=='1'}"
                                       type="text" value="正常">
                                <input class="layui-input" disabled name="isOnline" th:if="${monitorDbVo.isOnline=='' || monitorDbVo.isOnline==null}"
                                       type="text" value="未知">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">新增时间</label>
                            <div class="layui-input-block">
                                <input class="layui-input" disabled name="insertTime" th:value="${#dates.format(monitorDbVo.insertTime,'yyyy/MM/dd HH:mm:ss')}"
                                       type="text">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">更新时间</label>
                            <div class="layui-input-block">
                                <input class="layui-input" disabled name="updateTime" th:value="${#dates.format(monitorDbVo.updateTime,'yyyy/MM/dd HH:mm:ss')}"
                                       type="text">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script charset="utf-8" src="./js/common.js" th:src="@{/js/common.js}"></script>
<script src="./layui/layui.js" th:src="@{/layui/layui.js}"></script>
<script charset="utf-8" th:inline="javascript">
    var extend = {
        index: 'lib/index'//主入口模块
    };
    var use = ['index', 'element', 'form'];
    if ([[${monitorDbVo.dbType}]].toLowerCase() === 'mongo') {
        extend.dbInfo4mongo = 'db/dbInfo4mongo';
        use.push('dbInfo4mongo');
    }
    layui.config({
        base: ctxPath //静态资源所在路径
    }).extend(extend).use(use);
</script>
</body>
</html>